<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>主页面</title>
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=0">
	<link rel="stylesheet" type="text/css" href="../css/mainPage.css">
	<link rel="stylesheet" type="text/css" href="../lib/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="../lib/fontasome/css/font-awesome.css">
	<script type="text/javascript" src="../lib/polyfill.min.js"></script>
	
	<script type="text/javascript" src="../lib/vue.min.js"></script>
	<script type="text/javascript" src="../lib/vue-router.min.js"></script>
	<script type="text/javascript" src="../lib/vue-resource.min.js"></script>


	 
</head>
<body>
	<div class="view_box">
		<router-view></router-view>

		<footer>
			<ul>
				<li>
					<router-link to="/message"  active-class="active">
						<span><i class="fa fa-comment" aria-hidden="true"></i></span>
						<p>信息</p>
					</router-link>
				</li>
				<li>
					<router-link to="/contact"  active-class="active">
						<span><i class="fa fa-list" aria-hidden="true"></i></span>
						<p>联系人</p>
					</router-link>
				</li>
				<li>
					<router-link to="/set"  active-class="active">
						<span><i class="fa fa-cog" aria-hidden="true"></i></span>
						<p>设置</p>
					</router-link>
				</li>
			</ul>
		</footer>

	</div>

	<template id="message_view">
		<div class="background">
		<div class="mailImfo">
			<div class="mailbox">
				<div class="btn" :class="{'active':$parent.issend==0}">收件箱</div>
				<div class="btn" :class="{'active':$parent.issend==1}">回收站</div>
			</div>
			<div v-for="(recvMail,rindex) in $parent.allMail" v-if="(recvMail.isbin==0)&&($parent.issend==0)">
				<div class="Button messageButton" @click="window.toMessage(recvMail,1)"
			>
					<img :src="$parent.isopen(recvMail.issend)" alt="">
					<div>
						<p class="title">{{recvMail.title}}</p>
						<p class="user_name">{{recvMail.sendid}}</p>
						<p>{{recvMail.abstract}}...<span>{{recvMail.sendtime}}</span></p>
					
					</div>
				</div>
			</div>
			<div v-for="(binMail,sindex) in $parent.allMail" v-if="(binMail.isbin==1)&&($parent.issend==1)">
				<div class="Button messageButton" @click="window.toMessage(binMail,0)"
			>
					<img src="file:///android_res/drawable/ic_mail_watch.png" alt="">
					<div>
						<p class="title">{{binMail.title}}</p>
						<p class="user_name">{{binMail.sendid}}</p>
						<p>{{binMail.abstract}}<span>{{binMail.sendtime}}</span></p>
					
					</div>
				</div>
			</div>
		</div>
		</div>
	</template>
	<template id="contact_view">
		<div class="background">
			<div class="searchText">
				<input type="text" class="form-control" v-model="$parent.searchName">
			</div>
			<div v-for="(friend,index) in $parent.allAddress" v-if="friend.user2.search($parent.searchName)>-1
            ||friend.nickname.search($parent.searchName)>-1">
			<div class="Button contactButton" >
				<img :src="window.android.getIcon(friend.icon)" alt="">
				<div @click="window.toUpdateAddress(friend)">
					
					<h3>{{friend.nickname}}</h3>
					<p>{{friend.user2}}</p>
					
				</div>
				<a @click="window.toSendMessage(friend.user2)">
						<img src="file:///android_res/drawable/ic_mail_unwatch.png" alt="">
					</a>
			</div>
			</div>
		</div>
	</template>
	<template id="set_view">
		<div class="background">
			<div class="Button contactButton personalButton" @click="window.toUpdateUser()">
				<img :src="$parent.icon" alt="">
				<div>
					<p>{{$parent.userID}}</p>
					<p style="color: #c6c6c6;">点击修改头像密码</p>
				</div>
			</div>
			<div class="Button setButton" @click="window.clearImg()">
				<p>清空图片</p>
			</div>
			<div class="Button setButton" @click="window.toCollection()">
				<p class="last">收藏</p>
			</div>
			<div @click="window.logoff()" class="Button setButton exitButton">
				<p class="last">退出登录</p>
			</div>
		</div>
	</template>

	<script type="text/javascript" src="../js/index.js"></script>
</body>
</html>